import request from '@/utils/request'

// 开始就诊
export function startTreatment(data: any) {
  return request({
    url: '/api/outpatient/treatments/start_treatment/',
    method: 'post',
    data
  })
}

// 结束就诊
export function endTreatment(id: number) {
  return request({
    url: `/api/outpatient/treatments/${id}/end_treatment/`,
    method: 'post'
  })
}

// 获取就诊记录列表
export function getTreatments(params?: any) {
  return request({
    url: '/api/outpatient/treatments/',
    method: 'get',
    params
  })
}

// 获取就诊记录详情
export function getTreatmentDetail(id: number) {
  return request({
    url: `/api/outpatient/treatments/${id}/`,
    method: 'get'
  })
}

// 创建就诊记录
export function createTreatment(data: any) {
  return request({
    url: '/api/outpatient/treatments/',
    method: 'post',
    data
  })
}

// 更新就诊记录
export function updateTreatment(id: number, data: any) {
  return request({
    url: `/api/outpatient/treatments/${id}/`,
    method: 'put',
    data
  })
}

// 删除就诊记录
export function deleteTreatment(id: number) {
  return request({
    url: `/api/outpatient/treatments/${id}/`,
    method: 'delete'
  })
} 